function GetBingMapKey()
{
	var bingKey;
	GetAllKeysInXml();
	return bingKey;
	
	function GetAllKeysInXml()
	{
		var xHttp;
		if(window.XMLHttpRequest)
		{
			xHttp = new XMLHttpRequest();
		}
		else
		{
			xHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		xHttp.open("GET", "new_BingMapKeys", false);
		xHttp.send();
		var xmlDoc =xHttp.responseXML;

		var keys = xmlDoc.getElementsByTagName('key');
		var currentUserId = GetCurrentUserId();
		for(i=0;i<keys.length;i++)
		{
			attributes = keys[i].attributes;
			var idNode = attributes.getNamedItem("id");
			if (idNode) {
				var value = idNode.nodeValue;
				//Need to do more reliable comparison here.
				if (value == currentUserId) {
					bingKey = keys[i].text;
					return;
				}
			}
		}

		if (keys[0].text) {
			bingKey = keys[0].text;
		}
		else {
			bingKey = keys[0].textContent;
		}
		return;
	}
	
	function GetCurrentUserId()
	{
		//Assuming that ClientGlobalContext.js is already loaded by calling page.
		var new_context = GetGlobalContext();
		return new_context.getUserId();
	}
}